#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
@file:1.py
@author:1740681566@qq.com
@date:	2018/04/20
@version: 
    v1.1 2018-04-20 fix bug
    v1.0 2018-04-20 create
@input:	需要就写，不需要就不写
@output:需要就写，不需要就不写

模块功能简述,Get a list of maximum `limit` number of users with user id starting from `start_uid`
"""
all_goods = {'单号': {'name': '品名', 'price': '单价'}, 1: {'name': '苹果', 'price': 1},
             2: {'name': '水果', 'price': 2}, 3: {'name': '牛奶', 'price': 3}, 4: {'name': '西瓜', 'price': 2}}
user_money = float(input("please input your money:"))

for i in all_goods:
    print(i, all_goods[i]['name'], all_goods[i]['price'])

# for a in enumerate(all_goods):
#     print(a)
b = [0, 0, 0, 0]
ss = 0
for s in range(4):
    bh = input('请输入你要买的商品的编号，注意输入一个编号需要输入次回车，输入stop停止：')
    if bh == 'stop':
        break
    b[s] = int(bh)
    ss += all_goods[int(bh)]['price']
if ss < user_money:
    for i in all_goods:
        print(i, all_goods[i]['name'], all_goods[i]['price'])
        break
    for s in b:
        if s == 0:
            break
        print(s, all_goods[s]['name'], all_goods[s]['price'])
else:
    print("对不起，您的钱不够！")

